Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents

Managing Mipmap Textures

QuickDraw 3D provides routines that you can use to create and manipulate mipmap textures. A mipmap is stored in a structure of type TQ3Mipmap, which may contain up to 32 images of type TQ3MipmapImage:

typedef struct TQ3Mipmap {
    TQ3StorageObject    image;
    TQ3Boolean          useMipmapping;
    TQ3PixelType        pixelType;
    TQ3Endian           bitOrder;
    TQ3Endian           byteOrder;
    unsigned long       reserved;       /* NULL */
    TQ3MipmapImage      mipmaps[32];
} TQ3Mipmap;
typedef struct TQ3MipmapImage {
    unsigned long       width;  
    unsigned long       height;
    unsigned long       rowBytes;
    unsigned long       offset; 
} TQ3MipmapImage;
image
A storage object containing the texture map; if useMipmapping is kQ3True , it contains the mipmap data.
useMipmapping
kQ3True if mipmapping should be used and all mipmaps are provided.
mipmaps
Images of type TQ3MipmapImage. The actual number of mipmaps is determined by the size of the first mipmap.
width
Width of the mipmap; must be a power of 2.
height
Height of the mipmap; must be a power of 2.
rowBytes
Rowbytes of the mipmap.
offset
Offset from the image base to this mipmap.

Q3MipmapTexture_New

You can use the Q3MipmapTexture_New function to create a new mipmap texture.

TQ3TextureObject Q3MipmapTexture_New (const TQ3Mipmap *mipmap);
mipmap
A mipmap.

DESCRIPTION

The Q3MipmapTexture_New function returns, as its function result, a new texture object that uses the mipmap specified by the mipmap parameter. If Q3MipmapTexture_New cannot create a new mipmap texture object, it returns the value NULL .

Q3MipmapTexture_GetMipmap

You can use the Q3MipmapTexture_GetMipmap function to get the mipmap associated with a mipmap texture object.

TQ3Status Q3MipmapTexture_GetMipmap (
                     TQ3TextureObject texture,
                     TQ3Mipmap *mipmap);
texture
A mipmap texture object.
mipmap
On exit, the mipmap currently associated with the specified mipmap texture object.

DESCRIPTION

The Q3MipmapTexture_GetMipmap function returns, in the mipmap parameter, the mipmap currently associated with the mipmap texture object specified by the texture parameter.

Q3MipmapTexture_SetMipmap

You can use the Q3MipmapTexture_SetMipmap function to set the mipmap associated with a mipmap texture object.

TQ3Status Q3MipmapTexture_SetMipmap (
                     TQ3TextureObject texture,
                     const TQ3Mipmap *mipmap);
texture
A mipmap texture object.
mipmap
The mipmap to be associated with the specified mipmap texture object.

DESCRIPTION

The Q3MipmapTexture_SetMipmap function sets the mipmap to be associated with the mipmap texture object specified by the texture parameter to the mipmap specified by the mipmap parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents